find_package(Doxygen)

message(STATUS "PROJECT_NAME: ${PROJECT_NAME}")
message(STATUS "VENUS_VERSION: ${VENUS_VERSION}")

if(NOT DOXYGEN_FOUND)
  message(STATUS "CANNOT find Doxygen. Docs will not genarate...")
else()
    message(STATUS "Find Doxygen, will build the documentation.")
    set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
    set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
    configure_file(${doxyfile_in} ${doxyfile} @ONLY)

    add_custom_target(dustin_doc
        COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
        COMMENT "Generating API documentation with Doxygen"
        VERBATIM)
endif()
